SaveAsDialog Class

Used to create customized Save As dialogs. Non-customizable Save As dialogs are created by the GetSaveFolderItem function.

Events

None

Properties

None

Methods

None

More information available in parent classes: FolderItemDialog:Object


Notes

Using the properties of the FolderItemDialog class, you can customize the following aspects of a save-file dialog box:

Position (Left and Top properties)

Default directory (Initial Directory property)

Valid file types to show (Filter property). If you specify more than one file type (separate the file type names with semicolons), SaveAsDialog will add a Format pop-up menu to the dialog, allowing the user to specify the desired file type to use. Examine the extension of the file name returned to see which format was chosen.

Default filename (SuggestedFileName property)

Text of the Validate and Cancel buttons (ActionButtonCaption and CancelButtonCaption properties)

Text that appears in the Title bar of the dialog (Title property)

Text that appears in the body of the dialog (PromptText property)

On Mac OS X, a Hide Filename Extension checkbox appears in the save-file dialog. The FolderItem returned has its ExtensionVisible property set according to the user's use of this checkbox.


Example

The following example opens a customized save-file dialog box and displays the contents of the "Documents" directory in the browser area.

Dim dlg as New SaveAsDialog
Dim f as FolderItem
dlg.InitialDirectory= Volume(0).Child("Documents")
dlg.promptText="Prompt Text"
dlg.SuggestedFileName="Suggested Filename"
dlg.Title="Title Property"
dlg.Filter=TextTypes.text  //defined as a file type in TextTypes File Type Set
f=dlg.ShowModal()
If f <> Nil then
 //file saved
Else
//user canceled
End if

See Also

FileType, FolderItem, FolderItemDialog, OpenDialog, SelectFolderDialog classes; GetSaveFolderItem function.